<template>
  <div class="dashboard">
    <div>
      <div class="balance">
        <div><span>{{$t('MineBalance')}}（USDT）</span><img
            src=""
            alt="" class="password-icon">
          <p>{{myInfo.money}}</p></div>
      </div>
      <div class="count">
        <div class="count-item">
          <div><span>0</span>
            <p>{{ $t('MineNavItem4') }}</p></div>
        </div>
        <div class="count-item">
          <div><span>0</span>
            <p>{{ $t('MineNavItem5') }}</p></div>
        </div>
      </div>
      <div class="visit">
        <div class="visit-title">{{ $t('MineNavItem5') }}</div>
        <no-data />
      </div>
    </div>
    <div class="recharge">
      <div class="box-btn" @click="jumpToRecharge">
        <div class="tit">{{$t('CommonRecharge')}}</div>
        <img src="@/assets/images/icon-arrow-down.svg" alt="recharge" class="icon">
      </div>
      <div class="collection">
        <div class="tit">{{ $t('MineNavItem4') }}</div>
        <no-data />
      </div>
      <div class="el-dialog__wrapper" style="display: none;">
        <div role="dialog" aria-modal="true" aria-label="充值"
             class="el-dialog el-dialog--center recharge-method-dialog" style="margin-top: 15vh;">
          <div class="el-dialog__header"><span class="el-dialog__title">充值</span>
            <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i
                class="el-dialog__close el-icon el-icon-close"></i></button>
          </div><!----><!----></div>
      </div>
      <div class="el-dialog__wrapper" style="display: none;">
        <div role="dialog" aria-modal="true" aria-label="充值" class="el-dialog wallet-dialog"
             style="margin-top: 15vh;">
          <div class="el-dialog__header"><span class="el-dialog__title">充值</span>
            <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i
                class="el-dialog__close el-icon el-icon-close"></i></button>
          </div><!----><!----></div>
      </div>
      <div class="el-dialog__wrapper es-dialog" style="display: none;">
        <div role="dialog" aria-modal="true" aria-label="dialog" class="el-dialog el-dialog--center"
             style="margin-top: 15vh; width: 475px;">
          <div class="el-dialog__header">
            <div class="dialog-title"><span>输入交易密码</span><!----><!---->
            </div>
            <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i
                class="el-dialog__close el-icon el-icon-close"></i></button>
          </div><!----><!----></div>
      </div>
    </div>
    <div class="withdraw">
      <div class="box-btn" @click="jumpToWithdraw">
        <div class="tit">{{ $t('CommonWithdraw') }}</div>
        <img src="@/assets/images/icon-arrow-down.svg" alt="withdraw" class="icon">
      </div>
      <div class="collection">
        <div class="tit">{{$t('MineDefaultAddress')}}</div>
        <div class="add_list">
          <div class="item">
            <div class="info">
              <div class="name-and-mobile"><span class="name">样样</span><span
                  class="mobile">&nbsp;&nbsp;+93 15055287798</span></div>
              <div role="switch" aria-checked="true" class="el-switch is-checked"><input
                  type="checkbox" name="" true-value="1" false-value="0" class="el-switch__input"><!----><span
                  class="el-switch__core" style="width: 40px;"></span><!----></div>
            </div>
            <div class="address"> 荷兰 乌得勒支 阿美龙根 详细地址</div>
          </div>
        </div>
      </div>
      <div class="add-btn flex-center"><span>{{$t('MineNewAddress')}}</span></div>
      <div class="el-dialog__wrapper" style="display: none;">
        <div role="dialog" aria-modal="true" aria-label="提现"
             class="el-dialog el-dialog--center wallet-dialog withdraw-dialog" style="margin-top: 15vh;">
          <div class="el-dialog__header"><span class="el-dialog__title">提现</span>
            <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i
                class="el-dialog__close el-icon el-icon-close"></i></button>
          </div><!----><!----></div>
      </div>
      <div class="el-dialog__wrapper" style="display: none;">
        <div role="dialog" aria-modal="true" aria-label="dialog" class="el-dialog el-dialog--center es-dialog"
             style="margin-top: 15vh; width: 600px;">
          <div class="el-dialog__header">
            <div class="dialog-title"><span>添加地址/修改地址</span></div>
            <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i
                class="el-dialog__close el-icon el-icon-close"></i></button>
          </div><!----><!----></div>
      </div>
      <div class="el-dialog__wrapper es-dialog" style="display: none;">
        <div role="dialog" aria-modal="true" aria-label="dialog" class="el-dialog el-dialog--center"
             style="margin-top: 15vh; width: 475px;">
          <div class="el-dialog__header">
            <div class="dialog-title"><span>输入交易密码</span><!----><!---->
            </div>
            <button type="button" aria-label="Close" class="el-dialog__headerbtn"><i
                class="el-dialog__close el-icon el-icon-close"></i></button>
          </div><!----><!----></div>
      </div>
    </div>
  </div>
</template>
<script setup>
import { useRouter } from "vue-router";
import NoData from "@/components/common/NoData.vue";
import {ref} from "vue";
import {mine} from "@/api/index.js";
const router = useRouter()
const myInfo = ref({})
const getMyInfo = () => {
  mine().then(res => {
    myInfo.value = res.data
  }).catch(err => {})
}
getMyInfo()
const jumpToRecharge = () => {
  router.push('/mine/money-package/recharge')
}
const jumpToWithdraw = () => {
  router.push('/mine/money-package/withdraw')
}
</script>
<style scoped>
.dashboard {
  flex: 1;
  padding: 20px 0 0 50px;
  display: flex
}
.balance {
  width: 250px;
  height: 85px;
  text-align: center;
  background: url();
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px
}

.balance i,.balance span {
  color: var(--color-white);
  font-size: 12px;
  cursor: pointer
}

.balance .password-icon {
  width: 16px;
  cursor: pointer
}

.balance p {
  font-size: 26px;
  font-weight: 600;
  color: var(--color-price)
}

.count-item {
  width: 248px;
  height: 83px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--color-little-grey);
  text-align: center;
  margin-bottom: 20px;
  border: 1px solid var(--color-border);
  cursor: pointer
}

.count-item p {
  font-size: 12px;
  color: var(--color-title)
}

.count-item span {
  font-size: 18px;
  color: var(--color-main)
}

.visit {
  width: 250px;
  border: 1px solid var(--color-border)
}

.visit-title {
  width: 100%;
  height: 49px;
  line-height: 50px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border);
  padding-left: 12px;
  margin-bottom: 10px
}

.visit-btn {
  width: 100%;
  height: 26px;
  background: var(--color-submain1);
  border: 1px solid var(--color-main);
  border-radius: 27px;
  margin: 10px 0 5px;
  font-size: 12px;
  color: var(--color-main);
  line-height: 0
}

.visit-item {
  width: 223px;
  margin: 0 auto
}

.visit-item .avatar {
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center
}

.visit-item .avatar>img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
  margin: 0
}

.visit-item-box {
  padding: 7px 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  margin-bottom: 10px
}

.visit-item-box-flex {
  display: flex;
  align-items: center
}

.visit-item-desc {
  flex: 1;
  padding-left: 10px
}

.visit-item-desc span {
  color: var(--color-black);
  font-size: 12px
}

.visit-item-text {
  color: var(--color-title);
  font-size: 10px;
  margin-top: 3px
}
.recharge {
  margin-left: 52px;
  width: 250px;
  display: flex;
  flex-direction: column
}

.recharge .collection {
  margin-top: 20px;
  width: 249px;
  border: 1px solid #eee;
  border-radius: 4px
}

.recharge .collection>.tit{
  height: 50px;
  line-height: 50px;
  padding: 0 13px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  font-weight: 500;
  color: #333
}

.recharge .collection>.dash_list>.item{
  display: flex;
  padding: 10px;
  cursor: pointer;
  position: relative
}

.recharge .collection>.dash_list>.item .removed{
  position: absolute;
  background-color: rgba(0,0,0,.4);
  border-radius: 4px;
  color: #fff;
  padding: 5px 10px;
  font-size: 12px;
  top: 50%;
  z-index: 9;
  transform: translateY(-50%)
}

.recharge .collection>.dash_list>.item .discount{
  width: 31px;
  height: 32px;
  background: url() no-repeat 100%/100%;
  position: absolute;
  top: 0;
  left: 0;
  text-align: center;
  font-size: 11px;
  color: #fff;
  font-weight: 500
}

.recharge .collection>.dash_list>.item+.item{
  border-top: 1px solid #eee
}

.recharge .collection>.dash_list>.item>.poster{
  width: 60px;
  height: 60px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.recharge .collection>.dash_list>.item>.poster>img{
  width: 100%;
  height: auto
}

.recharge .collection>.dash_list>.item>.info{
  flex: 1;
  width: 0;
  min-width: 0;
  padding: 3px 0;
  padding-left: 10px;
  display: flex;
  flex-direction: column
}

.recharge .collection>.dash_list>.item>.info>.tit{
  width: 100%;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 400;
  color: #333
}

.recharge .collection>.dash_list>.item>.info>.detail{
  flex: 1;
  height: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end
}

.recharge .collection>.dash_list>.item>.info>.detail .price{
  color: var(--color-price)
}

.recharge .collection>.dash_list>.item>.info>.detail .num{
  font-size: 12px
}
.box-btn {
  background-color: #fafafa;
  border: 1px solid #eee;
  border-radius: 4px;
  height: 85px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #333;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  cursor: pointer;
  transition-duration: .3s
}

.box-btn:hover {
  box-shadow: 0 1px 2px 1px rgba(0,0,0,.05)
}

.box-btn .icon {
  width: 32px;
  height: 32px;
  margin-top: 8px;
  transform: rotate(180deg)
}

.withdraw{
  margin-left: 52px;
  display: flex;
  flex-direction: column;
}
.withdraw-dialog .record{
  border: 1px solid var(--color-border);
  margin: 0 0 15px
}

.withdraw-dialog .record .record-item{
  font-weight: 400;
  font-size: 14px;
  padding: 16px 10px;
  border-bottom: 1px solid var(--color-border)
}

.withdraw-dialog .record .record-item:last-child {
  border-bottom: 0
}

.withdraw-dialog .record .record-item .label{
  color: var(--color-title)
}

.withdraw-dialog .record .record-item .value{
  color: var(--color-main)
}

.withdraw-dialog .record .record-item .success{
  color: var(--color-success)
}

.withdraw-dialog .record .record-item .fail{
  color: var(--color-fail)
}

.withdraw-dialog .record .record-item .el-icon-copy-document{
  cursor: pointer
}

.withdraw-dialog .info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 27px;
  font-size: 12px
}

.withdraw-dialog .info .price {
  color: var(--color-main)
}

.withdraw-dialog .withdraw-tips span:first-child {
  font-weight: 400;
  font-size: 12px;
  color: var(--color-subtitle)
}

.withdraw-dialog .withdraw-tips span:last-child {
  font-weight: 400;
  font-size: 12px;
  color: var(--color-main)
}
.withdraw .collection{
  margin-top: 20px;
  width: 249px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  position: relative;
}
.withdraw .collection>.tit{
  height: 50px;
  line-height: 50px;
  padding: 0 13px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  font-weight: 500;
  color: var(--color-title)
}

.withdraw .collection>.add_list>.item{
  padding: 10px;
  font-size: 12px
}

.withdraw .collection>.add_list>.item+.item{
  border-top: 1px solid var(--color-border)
}

.withdraw .collection>.add_list>.item>img{
  width: 60px;
  height: 60px
}

.withdraw .collection>.add_list>.item>.info{
  display: flex
}

.withdraw .collection>.add_list>.item>.info .name-and-mobile{
  flex: 1;
  font-weight: 400;
  color: var(--color-title)
}

.withdraw .collection>.add_list>.item>.info .name-and-mobile span{
  display: inline-block
}

.withdraw .collection>.add_list>.item>.info .name-and-mobile .mobile,.withdraw .collection>.add_list>.item>.info .name-and-mobile .name{
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.withdraw .collection>.add_list>.item>.address{
  color: var(--color-subtitle);
  font-weight: 500;
  margin-top: 5px;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}
.withdraw .add-btn {
  background-color: var(--color-little-grey);
  height: 85px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  margin-top: 20px;
  cursor: pointer
}

.withdraw .add-btn span {
  font-weight: 400;
  font-size: 18px;
  color: var(--color-main)
}

.withdraw .add-btn:hover {
  background-color: var(--color-submain1)
}

.right {
  cursor: pointer
}
</style>